#include <iostream>
using namespace std;
#include <vector>
#include <string>

void test6(void)
{
	class Solution {
	public:
		string NumToStr[10] = { "", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz" };
		void combine(string digits, int di, vector<string>& numStr, string combinestr)
		{
			if (di == digits.size())
			{
				numStr.push_back(combinestr);
				return;
			}
			//获取当前按下的数字键位,并映射对应的字符串
			int num = digits[di] - 48;
			cout << digits[di] << endl;
			cout << num << endl;
			string str = NumToStr[num];
			for (auto ch : str)
			{
				combine(digits, di + 1, numStr, combinestr + ch);
			}
		}
		vector<string> letterCombinations(string digits) {
			vector<string> numStr;  //最终存放结果的string数组
			if (digits == "")
				return numStr;
			string str;     //用于存放单次的字符组合
			combine(digits, 0, numStr, str);    //进行递归

			return numStr;
		}
	};
	Solution s;

	vector<string> VS = s.letterCombinations("3452");
	cout << VS[1][1] << endl;
}
int main()
{
    test6();

    return 0;
}
